package com.h2cloud.Proxy;

import org.springframework.aop.framework.AopProxyUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

/**
 * @Package: com.h2cloud.Proxy
 * @ClassName: Controller
 * @Author: wulongkai
 * @CreateTime: 2024/8/27 14:22
 * @Description:
 */
@Controller
public class MyController {

    @Autowired
    private TestServiceImpl testService;

    public void get() {
        testService.print();

        Object singletonTarget = AopProxyUtils.getSingletonTarget(testService);
        ((TestServiceImpl)singletonTarget).print();

        testService.print3();
    }
}
